package com.leetcode.No0004;

import org.junit.Test;

/**
 * @author Louzen
 */
public class Solution02 {

//	public double findMedianSortedArrays(int[] nums1, int[] nums2) {
//
//		int len1 = nums1.length;
//		int len2 = nums2.length;
//		int dstInd = (len1 + len2) / 2;
//
//
//	}

	public double findMidNum(int[] nums1, int leftInd1, int[] nums2, int leftInd2, int remain) {
		if(remain == 1) {

		}

		int ind1 = Math.min(nums1.length, leftInd1 + remain / 2) - 1;
		int ind2 = Math.min(nums2.length, leftInd2 + remain / 2) - 1;

		if(nums1[ind1] <= nums2[ind2]) {
			return findMidNum(nums1, ind1, nums2, leftInd2, remain - ind1 + leftInd1);
		} else {
			return findMidNum(nums1, leftInd1, nums2, ind2, remain - ind2 + leftInd2);
		}
	}

}
